import { utils } from 'hi-ui';
import { currentUserID } from "@/utils/common.js";
export default {
    id: "ShopEntity",
    returnTotal: true,
    modelFile: "database/shop/dataset/ShopEntity.xml",
    sortFields: [
        "FID",
        "FNUMBER",
        "FDESC",
        "FCASHREGISTER",
        "FTEL",
        "FADDRESS",
        "FNOTE",
        "FEAST",
        "FWEST",
        "FENTERPRISEDESC",
        "FENTERPRISEID",
        "FCREATEDATE",
        "FUSERID",
        "FIMG",
        "FRATE",
        "FPINYIN",
        "FJIANPIN",
        "FPROVINCE",
        "FCITY",
        "FCOUNTY",
        "FCONTACTMAN",
        "FBANKACCOUNT",
        "FACCOUNTMONEY",
        "FBANKACCOUNTID",
        "FBUSINESSLICENSE",
        "FDELIVERYAMOUNT"

    ],
    fields: {
        FID: {
            name: "FID", //字段ID
            label: "ID", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
            default: {
                //默认值
                //rule: 'first', //prior   填充规则
                exps: (data) => {
                    //填充表达式
                    return utils.string.guid();
                },
            },
        },

        FDESC: {
            name: "FDESC", //字段ID
            label: "门店名称", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
            required: true,
            fireTarget: ["FPINYIN", "FJIANPIN"]
        },
        FNUMBER: {
            name: "FNUMBER", //字段ID
            label: "编号", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,


        },
        FPINYIN: {
            name: "FPINYIN", //字段ID
            label: "拼音", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
            default: {
                //默认值
                //rule: 'first', //prior   填充规则
                exps: (data) => {
                    //填充表达式
                    return utils.string.getPinyin(data.FDESC || "");
                },
            },

        },
        FJIANPIN: {
            name: "FJIANPIN", //字段ID
            label: "简拼", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
            default: {
                //默认值
                //rule: 'first', //prior   填充规则
                exps: (data) => {
                    //填充表达式
                    return utils.string.getFirstPY(data.FDESC || "");

                },
            },
        },
        FCASHREGISTER: {
            name: "FCASHREGISTER", //字段ID
            label: "收银机", //字段描述
            dbtype: "dbString", //数据类型
            length: 50,
        },
        FTEL: {
            name: "FTEL", //字段ID
            label: "电话", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FADDRESS: {
            name: "FADDRESS", //字段ID
            label: "地址", //字段描述
            dbtype: "dbString", //数据类型
            length: 50,
        },
        FENTERPRISEDESC: {
            name: "FENTERPRISEDESC", //字段ID
            label: "企业名称", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FENTERPRISEID: {
            name: "FENTERPRISEID", //字段ID
            label: "企业ID", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FNOTE: {
            name: "FNOTE", //字段ID
            label: "备注", //字段描述
            dbtype: "dbString", //数据类型
            length: 250,
        },
        FEAST: {
            name: "FEAST", //字段ID
            label: "经度", //字段描述
            dbtype: "dbFloat", //数据类型

        },
        FWEST: {
            name: "FWEST", //字段ID
            label: "纬度", //字段描述
            dbtype: "dbFloat", //数据类型

        },
        FCOORDINATESDESC: {
            name: "FCOORDINATESDESC", //字段ID
            label: "坐标", //字段描述
            dbtype: "dbString", //数据类型
            required: true,
            length: 50,
        },
        FPROVINCE: {
            name: "FPROVINCE", //字段ID
            label: "省", //字段描述
            dbtype: "dbString", //数据类型
            required: true,
            readonly: true,
            length: 25,
        },
        FCITY: {
            name: "FCITY", //字段ID
            label: "市", //字段描述
            dbtype: "dbString", //数据类型
            required: true,
            readonly: true,
            length: 25,
        },
        FCOUNTY: {
            name: "FCOUNTY", //字段ID
            label: "区/县", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
            readonly: true,
        },

        FIMG: {
            name: "FIMG", //字段ID
            label: "图片", //字段描述
            dbtype: "dbString", //数据类型
            length: 250
        },
        FBUSINESSLICENSE: {
            name: "FBUSINESSLICENSE", //字段ID
            label: "营业执照", //字段描述
            dbtype: "dbString", //数据类型
            length: 250
        },
        FCONTACTMAN: {
            name: "FCONTACTMAN", //字段ID
            label: "联系人", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FRATE: {
            name: "FRATE", //字段ID
            label: "评分", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },

        FBANKACCOUNT: {
            name: "FBANKACCOUNT", //字段ID
            label: "银行账户", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FBANKACCOUNTID: {
            name: "FBANKACCOUNTID", //字段ID
            label: "银行账户ID", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FACCOUNTMONEY: {
            name: "FACCOUNTMONEY", //字段ID
            label: "账户金额", //字段描述
            dbtype: "dbInt", //数据类型
        },
        FUSERID: {
            name: "FUSERID", //字段ID
            label: "用户ID", //字段描述
            dbtype: "dbString", //数据类型
            required: true,
            readonly: true,
            length: 25,
            default: {
                //默认值
                exps: (data) => {
                    //填充表达式
                    return currentUserID();
                },
            },
        },
        FCREATEDATE: {
            name: "FCREATEDATE", //字段ID
            label: "创建日期", //字段描述
            dbtype: "dbDate", //数据类型
            required: true,
            readonly: true,
            default: {
                //默认值
                exps: (data) => {
                    //填充表达式
                    return utils.date.format(new Date(), "yyyy-MM-dd HH:mm:ss");
                },
            },
        },
        FDELIVERYAMOUNT: {
            name: "FDELIVERYAMOUNT", //字段ID
            label: "配送金额", //字段描述
            dbtype: "dbFloat", //数据类型

        },

    }
    //action: "autoAction",
}